﻿using HoangPhap.Data;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace HoangPhap.Bussiness
{
    public class Language
    {
        public List<EntityClasses.Language> SelectAll()
        {
            var lst = new List<EntityClasses.Language>();
            var ct = new HoangPhapDataContext().GetLanguagesSelectAllResults();
            if (ct.Rows.Count > 0)
            {
                lst.AddRange(from DataRow dt in ct.Rows
                             select new EntityClasses.Language
                             {
                                 Id = Convert.ToInt32(dt["ID"].ToString()),
                                 Name = dt["Name"].ToString(),
                                 CultureCode = dt["CultureCode"].ToString(),
                                 LanguageCode = dt["LanguageCode"].ToString(),
                                 CultureInfo = dt["CultureInfo"].ToString(),
                                 LogoUrl = dt["LogoUrl"].ToString()
                                 
                             });
            }
            return lst;
        }
    }
}
